import { QXEvent } from "qx-util";
import { IParam, TabExpPanelActionType, ITabExpPanelAbility, ITabExpPanelControllerParams, ITabExpPanelStore, TabExpPanelController, ICtrlEvent, ITabExpPanelController, ITabExpPanelModel } from "@/core";
import { useTabExpPanelAction, useTabExpPanelBasic, useTabExpPanelControllerParams, useTabExpPanelProps } from "@/hooks/widget/use-tab-exp-panel";
import { model } from "./tab-exp-viewtabexppanel-tab-exp-panel-model";
// 基于template/src/widgets/{{appEntities}}/{{ctrls@TABEXPPANEL}}-tab-exp-panel/{{spinalCase ctrl.codeName}}-tab-exp-panel-hook.ts.hbs生成
/**
 * 获取输入参数
 *
 * @export
 * @return {*}
 */
export function useProps() {
	return {
		...useTabExpPanelProps(),
	};
}

/**
 * 获取基础数据
 *
 * @export
 * @param {*} props
 * @return {*}
 */
export function useBasic(props: any) {
	return {
		...useTabExpPanelBasic(model, props),
	};
}

/**
 * 获取行为
 *
 * @export
 */
export function useAction(controller: any) {
	return {
		...useTabExpPanelAction(controller),
	};
}

/**
 * 获取控制器
 *
 * @export
 * @param {IParam} props
 * @param {QXEvent<ICtrlEvent<TabExpPanelActionType, ITabExpPanelAbility>>} evt
 * @return {*}
 */
export function useController(
	props: IParam,
	evt: QXEvent<ICtrlEvent<TabExpPanelActionType, ITabExpPanelAbility>>,
    otherParams: IParam = {},
): ITabExpPanelController<ITabExpPanelStore, ITabExpPanelAbility> {
	const params: ITabExpPanelControllerParams<TabExpPanelActionType, ITabExpPanelAbility> =
		useTabExpPanelControllerParams<ITabExpPanelStore, ITabExpPanelModel>(model, props, evt, otherParams);
  	return new TabExpPanelController(params);
}